com.droplets.api
Class MenuBar

java.lang.Object
  |
  +--com.droplets.api.MenuComponent
        |
        +--com.droplets.api.MenuBar
All Implemented Interfaces:
MenuContainer

public class MenuBar
extends MenuComponent
implements MenuContainer

Represents a horizontal bar with a series of pull-down application menus displayed at the top of a window. You set a window's menu bar directly using Window.setMenuBar(com.droplets.api.MenuBar).

MenuBars contain Menus. You add menus to a menu bar directly by calling add(com.droplets.api.Menu). The menus appear in the order that you add them, left to right.

Menus can only be added to a MenuBar during the Window.addAllComponents() method. Any attempt to add menus to a MenuBar outside this method results in an IllegalStateException. This is also the only time a MenuBar can be added to a window.

Register for menu events for a MenuBar by calling MenuComponent.addActionListener(com.droplets.api.event.ActionListener). The listener receives ActionEvents for all the items in all the menus in the menu bar.


Constructor Summary
MenuBar()
          Constructs a new MenuBar.
 
Method Summary
 Menu add(Menu m)
          Adds the specified menu to the end of this menu bar.
 
Methods inherited from class com.droplets.api.MenuComponent
addActionListener, getParent, removeActionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuBar

public MenuBar()
Constructs a new MenuBar.
Method Detail

add

public Menu add(Menu m)
Adds the specified menu to the end of this menu bar.
Parameters:
m - the menu to add.
Returns:
the menu added.


Copyright © Droplets, 2001. All Rights Reserved.